feat: support ansi for elt - #23928
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #23928 +/- ##
==========================================
+ Coverage 80.67% 80.70% +0.02%
==========================================
Files 1095 1095
Lines 372490 372554 +64
Branches 372490 372554 +64
==========================================
+ Hits 300517 300658 +141
+ Misses 54035 53926 -109
- Partials 17938 17970 +32 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Jefffrey
approved these changes
Jul 28, 2026
| } | ||
|
|
||
| #[test] | ||
| fn elt_ansi_valid_indices_ok() -> Result<()> { |
Contributor
There was a problem hiding this comment.
do we need these tests if theyre already covered by slts?
Contributor
Author
|
Thanks @Jefffrey for the review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #23929
Rationale for this change
Spark's
elterrors on out-of-range indices when ANSI is on, and returnsNULLwhen off. DataFusion previously always returnedNULL(there was aTODOfor this in the source).What changes are included in this PR?
elt.rs: readenable_ansi_modefromScalarFunctionArgs::config_options; raise"The index N is out of bounds. The array has M elements."in ANSI mode, keepNULLbehavior otherwise.NULLindexalways returns
NULL.elt.slt: add missing ANSI-off cases (index 0, negative, large,NULLindex,NULLvalue, vectorized) and a full ANSI-on section withstatement errorassertions.Are these changes tested?
Yes. New Rust unit tests and sqllogictest cases cover both modes.
Are there any user-facing changes?
With
enable_ansi_mode = true,elton invalid indices now errors instead of returningNULL. Default behavior unchanged. No API changes.